[Mini-OS] Fix stack closures
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 23 Nov 2007 16:22:36 +0000 (16:22 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 23 Nov 2007 16:22:36 +0000 (16:22 +0000)
So as to make backtracing tools happy, correctly close x86 stacks for
new threads as well as on callback in the x86_32 case since there is
no unwind marker.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
extras/mini-os/arch/x86/x86_32.S
extras/mini-os/arch/x86/x86_64.S

index b6f1be3a018a74f6e9b4f2410feeb69178ffdc4c..2d359ab44a46316c083a12563bebdc09966aa21c 100644 (file)
@@ -126,6 +126,7 @@ ENTRY(hypervisor_callback)
         cmpl $ecrit,%eax
         jb   critical_region_fixup
 11:     push %esp
+        xorl %ebp,%ebp
         call do_hypervisor_callback
         add  $4,%esp
         movl HYPERVISOR_shared_info,%esi
@@ -281,6 +282,8 @@ ENTRY(spurious_interrupt_bug)
 ENTRY(thread_starter)
     popl %eax
     popl %ebx
+    pushl $0
+    xorl %ebp,%ebp
     pushl %eax
     call *%ebx
     call exit_thread 
index 1b5e0f7b372934da155bca9b6cfa48e4dd41eedd..0f855777169adcb5b29b8214d42c872c1a9bd0ec 100644 (file)
@@ -380,6 +380,8 @@ ENTRY(page_fault)
 ENTRY(thread_starter)
         popq %rdi
         popq %rbx
+        pushq $0
+        xorq %rbp,%rbp
         call *%rbx
         call exit_thread